﻿CREATE PROCEDURE [acms].[User_GetAllByCustomProperty]
	@SiteId int,
	@Name varchar(20),
	@Value varchar(2000)
AS
	SELECT a.*
	From User_View a
		inner join [acms].[UserCustomProperty_View] b on a.Id = b.UserId
	Where IsNull(a.SiteId, @SiteId) = @SiteId
		and b.Name = @Name
		and b.Value = @Value
RETURN 0;